package com.union.vehicleassistant.module.common;

import android.annotation.SuppressLint;
import android.widget.TextView;

import androidx.annotation.NonNull;

import com.gyf.immersionbar.BarHide;
import com.gyf.immersionbar.ImmersionBar;
import com.jinrishici.sdk.android.JinrishiciClient;
import com.jinrishici.sdk.android.factory.JinrishiciFactory;
import com.jinrishici.sdk.android.listener.JinrishiciCallback;
import com.jinrishici.sdk.android.model.JinrishiciRuntimeException;
import com.jinrishici.sdk.android.model.PoetySentence;
import com.union.vehicleassistant.R;
import com.union.vehicleassistant.app.AppActivity;
import com.union.vehicleassistant.module.main.MainActivity;
import com.union.vehicleassistant.other.AppConfig;

@SuppressLint("CustomSplashScreen")
public class SplashActivity extends AppActivity {

    private TextView tvVersion;
    private TextView tvTip;

    @Override
    protected int getLayoutId() {
        return R.layout.activity_splash;
    }

    @Override
    protected void initView() {

        tvVersion = findViewById(R.id.tv_version);
        tvTip = findViewById(R.id.tv_tip);
    }

    @Override
    protected void initData() {

        /*tvVersion.setText(AppConfig.getVersionName());
        JinrishiciFactory.init(getContext());
        JinrishiciClient.getInstance().getOneSentenceBackground(new JinrishiciCallback() {
            @Override
            public void done(PoetySentence poetySentence) {
                tvTip.setText(poetySentence.getData().getContent());
            }

            @Override
            public void error(JinrishiciRuntimeException e) {

            }
        });*/

        postDelayed(() -> {
            startActivity(MainActivity.class);
            finish();
        }, 1200);

    }

    @NonNull
    @Override
    protected ImmersionBar createStatusBarConfig() {
        return super.createStatusBarConfig()
                // 隐藏状态栏和导航栏
                .hideBar(BarHide.FLAG_HIDE_BAR);
    }
}